package xiaodou.core.WeiboData
{
	import flash.events.ErrorEvent;
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	
	import xiaodou.core.WeiboData.enums.GenderEnum;
	import xiaodou.core.WeiboData.events.WeiboDataEvent;
	import xiaodou.core.WeiboData.events.WeiboEvent;
	
	public class WeiboAccountInfo extends EventDispatcher
	{
		
		private var _screen_name:String;
		private var _profile_image_url:String;
		private var _location:String;
		private var _gender:String;
		private var _access_token:String;
		private var _UID:String;
		private var _followers_count:int;
		private var _friends_count:int;
		private var _statuses_count:int;
		private var _verified:Boolean;
		private var _domain:String;
		
		private var _bLogin:Boolean;
		private var _bRefresh:Boolean;
		
		
		public function WeiboAccountInfo(target:IEventDispatcher=null)
		{
			super(target);
		}
		
		/**
		 *刷新账户 
		 */
		public function get bRefresh():Boolean
		{
			return _bRefresh;
		}

		/**
		 * @private
		 */
		public function set bRefresh(value:Boolean):void
		{
			var Evt:WeiboEvent = null;
			if(value)
			{
				Evt = new WeiboEvent(WeiboDataEvent.ACCOUNT_REFRESH_SUCCESS);
			}
			else
			{
				Evt = new WeiboEvent(WeiboDataEvent.ACCOUNT_REFRESH_ERROR);
				
			}
			
			dispatchEvent(Evt);
			_bRefresh = value;
		}

		/**
		 *个性域名
		 * @return 
		 * 
		 */		
		public function get domain():String
		{
			return "http://weibo.com/" + _domain;
		}

		public function set domain(value:String):void
		{
			_domain = value;
		}

		public function update(data:Object):void
		{
			
		}
		
		/**
		 *是否加V 
		 */
		public function set verified(value:Boolean):void
		{
			_verified = value;
		}

		
		public function get verified():Boolean
		{
			return _verified;
		}

		/**
		 *我的微博数 
		 */
		public function get statuses_count():int
		{
			return _statuses_count;
		}

		/**
		 * @private
		 */
		public function set statuses_count(value:int):void
		{
			_statuses_count = value;
		}

		/**
		 *我的关注 
		 */
		public function get friends_count():int
		{
			return _friends_count;
		}

		/**
		 * @private
		 */
		public function set friends_count(value:int):void
		{
			_friends_count = value;
		}

		/**
		 *我的粉丝 
		 */
		public function get followers_count():int
		{
			return _followers_count;
		}

		/**
		 * @private
		 */
		public function set followers_count(value:int):void
		{
			_followers_count = value;
		}

		/**
		 *是否已经登录 
		 */
		public function get bLogin():Boolean
		{
			return _bLogin;
		}

		/**
		 * @private
		 */
		public function set bLogin(value:Boolean):void
		{
			var loginEvt:WeiboEvent = null;
			if(value)
			{
				loginEvt = new WeiboEvent(WeiboDataEvent.LOGIN_SUCCESS);
			}
			else
			{
				loginEvt = new WeiboEvent(WeiboDataEvent.LOGIN_ERROR);
				
			}
			
			dispatchEvent(loginEvt);
			_bLogin = value;
		}

		/**
		 * 用户UID 
		 */
		public function get UID():String
		{
			return _UID;
		}

		/**
		 * @private
		 */
		public function set UID(value:String):void
		{
			_UID = value;
		}

		/**
		 * access token 
		 */
		public function get access_token():String
		{
			return _access_token;
		}

		/**
		 * @private
		 */
		public function set access_token(value:String):void
		{
			_access_token = value;
		}

		/**
		 *性别
		 */
		public function get gender():String
		{
			return _gender;
		}

		/**
		 * @private
		 */
		public function set gender(value:String):void
		{
			_gender = value;
		}

		/**
		 *用户所在地域 
		 */
		public function get location():String
		{
			return _location;
		}

		/**
		 * @private
		 */
		public function set location(value:String):void
		{
			_location = value;
		}

		/**
		 * 用户头像的URL
		 */
		public function get profile_image_url():String
		{
			return _profile_image_url;
		}

		/**
		 * @private
		 */
		public function set profile_image_url(value:String):void
		{
			_profile_image_url = value;
		}

		/**
		 * 账号的显示名称ID
		 */
		public function get screen_name():String
		{
			return _screen_name;
		}

		/**
		 * @private
		 */
		public function set screen_name(value:String):void
		{
			_screen_name = value;
		}
		
		public function OnGetTokenSuccess(e:WeiboEvent):void
		{
			dispatchEvent(e);
		}

	}
}